package com.shaw.client.mvc.goal;

import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import com.shaw.client.mvc.AppEvents;





public class TaskController extends Controller {

	  private TaskFolderView folderView;
	  private TaskView taskView;

	  public TaskController() {
	    registerEventTypes(AppEvents.INIT);
	    registerEventTypes(AppEvents.NavTasks);
	  }

	  @Override
	  public void initialize() {
	    super.initialize();
	    folderView = new TaskFolderView(this);
	    taskView = new TaskView(this);
	  }

	  public void handleEvent(AppEvent event) {
	    if (event.getType() == AppEvents.INIT) {
	      forwardToView(folderView, event);
	    } else if (event.getType() == AppEvents.NavTasks) {
	      forwardToView(taskView, event);
	    }
	  }

	}
